package sec5flowcontrol;

import sec5flowcontrol.data.Obj;

public class FlowControlFor {
	
	public static void main(String[] args) {
		check();
	}
	
	public static void check() {
		
		System.out.println("===== Init multible variables =====");
		for (int index = 0, count = 0; index < 5 && count < 6; index++, printOut(index)) {
			count += index;
			System.out.println(count); // Move out to test
		}
		

		System.out.println("===== primitive values =====");
		int [] array = {1, 2, 3};
		for (int num : array) {
			num++;
		}

		System.out.println("===== object values =====");
		String[] strs = {"s1", "s2", "s3"};
		for (String s : strs) {
			s = s.toUpperCase();
		}
		
		System.out.println("===== object values =====");
		Obj[] objs = {new Obj("a"), new Obj("b")};
		for (Obj obj : objs) {
			obj.setStr(obj.getStr().toUpperCase());
		}
		System.out.println("Debug & test!");
				
	}
	
	private static void printOut(int index) {
		System.out.println(index + 1000);
	}
	
}
